package com.chenbei.common.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

@Schema(description = "IP区域信息")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class IPRegionInfo {

    @Schema(description = "国家")
    private String country;

    @Schema(description = "地区")
    private String region;

    @Schema(description = "省份")
    private String province;

    @Schema(description = "城市")
    private String city;

    @Schema(description = "运营商")
    private String isp;

    public String getProvince() {
        return StringUtils.isBlank(province) || "0".equals(province) ? "" : province;
    }

    public String getCity() {
        return StringUtils.isBlank(city) || "0".equals(city) ? "" : city;
    }
}
